
http://www.cookbook-r.com/Graphs/Plotting_means_and_error_bars_(ggplot2)/


library(ggplot2)

zz <- file.path("U:","My Documents")

File.Location <- file.path(zz,"sumbeck.csv")
y <- read.csv(File.Location)
y <- data.frame(y)
attach(y)

sex <- factor(sex)

se=sd/sqrt(n)

ggplot(y, aes(x=sex, y=lnbeck, fill="red")) + 
geom_bar(position=position_dodge(), stat="identity") +
    geom_errorbar(aes(ymin=lnbeck-se, ymax=lnbeck+se),width=0.2, 
position=position_dodge(.9))

ggplot(y, aes(x=sex, y=lnbeck)) + 
geom_bar(position=position_dodge(), stat="identity") +
    geom_errorbar(aes(ymin=lnbeck-sd, ymax=lnbeck+sd),width=0.2, 
position=position_dodge(.9))

ggplot(y, aes(x=sex, y=lnbeck)) + 
    geom_errorbar(aes(ymin=lnbeck-sd, ymax=lnbeck+sd),width=0.2) +
     geom_line() +
    geom_point()



